<%-- 
    Document   : index
    Created on : 2009-3-25, 15:31:04
    Author     : g.huangjx
--%>

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<%
response.setHeader("Cache-Control", "no-cache");
String sortType="";
if(request.getParameter("sortType")!=null&&!request.getParameter("sortType").equals("")){
	sortType=request.getParameter("sortType");
}
String type="radio";
if(request.getParameter("type")!=null&&!request.getParameter("type").equals("")){
	type=request.getParameter("type");
}
String module = "radio";
	if (request.getParameter("module") != null
			&& !request.getParameter("module").equals("")) {
		module = request.getParameter("module");
	}
 %>
<html>
<head>
<base target="_self" />
<title>产品类型树</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">   
<script type="text/javascript" src="js/xtree2.js"></script>
<link type="text/css" rel="stylesheet" href="xtree.css" />
<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<script type="text/javascript" src="<s:url value="/script/easyajax.js"/>"></script>
<script language="javascript">
var productAjax=new AjaxObj();
var sortId="";
function getSel(){
    var ids=document.getElementsByName("products");
    var idstr="";
	var namestr="";
	for(i=0;i<ids.length;i++){
		if(ids[i].checked==true){
			idstr+=ids[i].value+",";
			namestr+=$$(productAjax.datas(i),"productName")+",";
		}
	}
	idstr=idstr.substring(0,idstr.length-1);
	namestr=namestr.substring(0,namestr.length-1);
	var arr=new Array();
	arr[0]=idstr;
	arr[1]=namestr;
	if(idstr==""){
		if(!confirm("未选择产品，是否要清空原来的产品?")){
			return;
		}
	}
	window.returnValue=arr;
	window.close();
}

function myFunction(id){
    sortId=id;
    var url="<s:url value="/business/product/viewNextproductRefSort.action"/>?conds.sort="+sortId;
	callSynchronized(url,function(XML){//同步调用
	    productAjax.xml=XML.responseXML;
	    productAjax.tableName=productTable;
	    productAjax.inputType="<%=module%>";
	    productAjax.createTable();
	});
}
function queryProduct(){
    var pName=document.getElementById("conds.productName").value;
    if(!pName||pName==""){
    	return;
    }
    var url="<s:url value="/business/product/viewNextproductRefSort2.action"/>";
    url+="?conds.productName="+encodeURIComponent(pName);
    //url+="?conds.productName="+encodeURIComponent(pName);
	callSynchronized(url,function(XML){//同步调用
	    productAjax.xml=XML.responseXML;
	    productAjax.tableName=productTable;
	    productAjax.inputType="<%=module%>";
	    productAjax.createTable();
	});
}

</script>
</head>
<body style="background:#CCCCCC;font-size:9pt" >
<button onclick="getSel();">确定</button>&nbsp;
<button onclick="window.close();">关闭</button>&nbsp;
    				<TABLE width="98%" border="0" cellspacing="0" cellpadding="0"
							align="center" class=tablecolor2>
							<tr>
								<td width="15%" height="50">
									产品名称&nbsp;
									<input id="conds.productName" name="conds.productName" type="text" value="${conds.productName}" size="16" />
									&nbsp;
									<input type="button" name="search" onclick="queryProduct();"
										value="查 询">
								</td>
							</tr>
						</TABLE>
<table width="100%" style="border: 1px solid white" height="95%">
	<tr>
   <td width="50%">
	<div style="float: left; width: 100%; height: 100%; border: 0px; overflow-x: hidden; overflow-y: scroll;">
	<script type="text/javascript">
	/// XP Look
	webFXTreeConfig.rootIcon		= "<s:url value="/xtreecheckbox/images/xp/folder.png"/>";
	webFXTreeConfig.openRootIcon	= "<s:url value="/xtreecheckbox/images/xp/openfolder.png"/>";
	webFXTreeConfig.folderIcon		= "<s:url value="/xtreecheckbox/images/xp/folder.png"/>";
	webFXTreeConfig.openFolderIcon	= "<s:url value="/xtreecheckbox/images/xp/openfolder.png"/>";
	webFXTreeConfig.fileIcon		= "<s:url value="/xtreecheckbox/images/xp/file.png"/>";
	webFXTreeConfig.lMinusIcon		= "<s:url value="/xtreecheckbox/images/xp/Lminus.png"/>";
	webFXTreeConfig.lPlusIcon		= "<s:url value="/xtreecheckbox/images/xp/Lplus.png"/>";
	webFXTreeConfig.tMinusIcon		= "<s:url value="/xtreecheckbox/images/xp/Tminus.png"/>";
	webFXTreeConfig.tPlusIcon		= "<s:url value="/xtreecheckbox/images/xp/Tplus.png"/>";
	webFXTreeConfig.iIcon			= "<s:url value="/xtreecheckbox/images/xp/I.png"/>";
	webFXTreeConfig.lIcon			= "<s:url value="/xtreecheckbox/images/xp/L.png"/>";
	webFXTreeConfig.tIcon			= "<s:url value="/xtreecheckbox/images/xp/T.png"/>";
	var atree = new WebFXLoadTree("集团产品目录","<s:url value='/' escapeAmp='false'/>"+"business/catalog/treeProductSort.action?conds.parentSort=0&conds.sortType=1&type=&date=<%=System.currentTimeMillis()%>&module=<%=module%>");
	document.write(atree);
	atree = new WebFXLoadTree("福建省产品目录","<s:url value='/' escapeAmp='false'/>"+"business/catalog/treeProductSort.action?conds.parentSort=0&conds.sortType=2&type=&date=<%=System.currentTimeMillis()%>&module=<%=module%>");
	document.write(atree);
	//window.prompt('',atree);
	</script>
</div></td><td>
<div style="float: right; width: 100%; height: 100%; border: 0px; overflow-x: hidden; overflow-y: scroll;">
    <form id="form1" style="dispaly:none">
    </form>

	<table align="center" id="productTable" width="100%"  border="0" cellspacing="0" cellpadding="1" align="center" class=tablecolor2>	
		<tr>
			<td bgcolor="9AC2EB" jtext="product" width="60" align="center">选择</td>
			<td bgcolor="9AC2EB" jtext="productName" align="center">产品名字</td>
			<td bgcolor="9AC2EB" jtext="sortName" align="center">产品类型</td>
		</tr>
	</table>	
</div></td>
	</tr>
</table>
</body>
</html>
